package com.heer.gymnasium.module.store.beans;

import com.heer.gymnasium.base.BaseBean;
import com.heer.gymnasium.module.common.beans.GlobeBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 集体课
 * Created by zy on 2018/1/25.
 */

public class CourseBean extends BaseBean {
    private String courseType;
    private String courseName;
    private String courseId;
    private String max_number;
    private String notice;


    public String getCourseType() {
        return courseType;
    }

    public void setCourseType(String courseType) {
        this.courseType = courseType;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public String getMax_number() {
        return max_number;
    }

    public void setMax_number(String max_number) {
        this.max_number = max_number;
    }

    public String getNotice() {
        return notice;
    }

    public void setNotice(String notice) {
        this.notice = notice;
    }

    public static List<CourseBean> dataChange(List<GlobeBean.Tag> list){
        List<CourseBean> courseBeanList = new ArrayList<>();
        for (GlobeBean.Tag tag: list){
            CourseBean bean = new CourseBean();
            bean.setCourseId(tag.getId());
            bean.setCourseName(tag.getName());
            courseBeanList.add(bean);
        }
        return courseBeanList;
    }

    public static CourseBean dataChange(CourseResponseBean data){
        CourseBean bean = new CourseBean();
        bean.setCourseId(data.getId());
        bean.setCourseName(data.getName());
        bean.setMax_number(String.format("限制人数:%s人",data.getMax_number()));
        bean.setNotice(data.getNotice());
        return bean;
    }
}
